package Job

import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD

object SalaryTop {
  def main(args: Array[String]): Unit = {
    val sc: SparkContext = new SparkContext("local[*]", "SalaryTop")
    val inputPath: String = "file/JobData/input"
    val outputPath: String = "file/JobData/output/SalaryTop"

    val InfoLine: RDD[String] = sc.textFile(inputPath).repartition(2)

    val res = InfoLine.map(x =>{
      (x.split(",")(2),x.split(",")(11).toInt)
    })
      .sortBy(_._2,ascending = false)

    res.take(7).foreach(println)

  }
}
